package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	CommunityEventNew           = "pm.CommunityNew"
	CommunityEventBeforeCreate  = "pm.CommunityBeforeCreate"
	CommunityEventBeforeUpdate  = "pm.CommunityBeforeUpdate"
	CommunityEventBeforeSave    = "pm.CommunityBeforeCreate pm.CommunityBeforeUpdate"
	CommunityEventAfterCreate   = "pm.CommunityAfterCreate"
	CommunityEventAfterUpdate   = "pm.CommunityAfterUpdate"
	CommunityEventAfterSave     = "pm.CommunityAfterCreate pm.CommunityAfterUpdate"
	CommunityEventDelete        = "pm.CommunityDelete"
	CommunityAccessControlEvent = "pm.CommunityAccessControl"
)

func GetCommunityConfig() *mgo.DocConfig {
	return Community_Config
}

var Community_Config *mgo.DocConfig

func init() {
	Community_Config = NewCommunityConfig()
}
func NewCommunityConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "pm.Community",
		Fields: []string{
			"name", "note",
		},
		RelationFields:  []string{},
		RelationConfigs: map[string]*mgo.DocRelation{},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
